{extend name="Base" /}
{block name="title"}{$title}{/block}
{block name="body"}
{load href="/js/backend/lodash.min.js"}
<script type='text/javascript' src='/js/backend/custom.js?{:VER}'></script>
<div class="layui-tab layui-tab-brief" lay-filter="tab">
	<ul class="layui-tab-title">
		<li class="layui-this">{$name1}</li>
		<li>{$name2}</li>
		<li>{$name3}</li>
		<li>{$name4}</li>
	</ul>
	<div class="layui-tab-content">
		<div class="layui-tab-item layui-show username_tab">
			<form class="layui-form">
				<div class="layui-form-item layui-form-text">
					<textarea name="username" placeholder="请输入要限制注册的用户名，使用英文逗号分割，比如：【admin,administrator,manager】" class="layui-textarea">{$username}</textarea>
				</div>
				<div class="layui-form-mid layui-word-aux">请输入要限制注册的用户名，使用英文逗号分割，比如：【admin,administrator,manager】；留空为不限制</div>
				<div class="layui-form-item">
					<button class="layui-btn" lay-submit lay-filter="username_submit">提交</button>
				</div>
			</form>
		</div>

		<div class="layui-tab-item email_tab">
			<form class="layui-form">
				<div class="layui-form-item layui-form-text">
					<textarea name="email" placeholder="请输入要限制注册的邮件域，使用英文逗号分割，比如：【@qq.com,@126.com,@163.com】" class="layui-textarea">{$email}</textarea>
				</div>
				<div class="layui-form-mid layui-word-aux">请输入要限制注册的邮件域，使用英文逗号分割，比如：【@outlook.com,@gmail.com,@live.com】；留空为不限制</div>
				<div class="layui-form-item">
					<button class="layui-btn" lay-submit lay-filter="email_submit">提交</button>
				</div>
			</form>
		</div>

		<div class="layui-tab-item only_tab">
			<form class="layui-form">
				<div class="layui-form-item layui-form-text">
					<textarea name="only" placeholder="请输入只允许注册的邮件域，使用英文逗号分割，比如：【@qq.com,@126.com,@163.com】" class="layui-textarea">{$only}</textarea>
				</div>
				<div class="layui-form-mid layui-word-aux">请输入只允许注册的邮件域，使用英文逗号分割，比如：【@qq.com,@126.com,@163.com】；留空为不限制</div>
				<div class="layui-form-item">
					<button class="layui-btn" lay-submit lay-filter="only_submit">提交</button>
				</div>
			</form>
		</div>

		<div class="layui-tab-item ip_tab">
			<form class="layui-form">
				<div class="layui-form-item layui-form-text">
					<textarea name="ip" placeholder="请输入要限制注册的IP，使用英文逗号分割，比如：【192.168.1.1,172.10.8.1,169.82.223.21/28】" class="layui-textarea">{$ip}</textarea>
				</div>
				<div class="layui-form-mid layui-word-aux">请输入要限制访问的IP，使用英文逗号分割，比如：【192.168.1.1,172.10.8.1,169.82.223.21/28】；留空为不限制</div>
				<div class="layui-form-item">
					<button class="layui-btn" lay-submit lay-filter="ip_submit">提交</button>
				</div>
			</form>
		</div>
	</div>
</div>

<script>
	layui.use(['form', 'layer'], function () {
		var form = layui.form;
		var layer = layui.layer;

		form.on('submit(username_submit)', function (data) {
			send(data.field, "users", "doLimit");
			return false;
		});
		form.on('submit(email_submit)', function (data) {
			send(data.field, "users", "doLimit");
			return false;
		});
		form.on('submit(only_submit)', function (data) {
			send(data.field, "users", "doLimit");
			return false;
		});
		form.on('submit(ip_submit)', function (data) {
			send(data.field, "users", "doLimit");
			return false;
		});
	});
</script>
{/block}